---
layout: m1x_soap
title: Sales Order Credit Memo
---

				    
				    <h2><a name="MAPI-OrderCreditMemo-Module%3ASalesOrderCreditmemo"></a>Module: Sales_Order_Creditmemo</h2>

<p>Allows you to operate with credit memos for orders.</p>


<h4><a name="MAPI-OrderCreditMemo-Resource%3Asalesordercreditmemo"></a>Resource: sales_order_creditmemo</h4>

<p><b>Aliases</b>: order_creditmemo</p>

<h5><a name="MAPI-OrderCreditMemo-Methods%3A"></a>Methods:</h5>

<ul>
	<li><a href="sales_order_creditmemo.list.html" title="sales_order_creditmemo.list">sales_order_creditmemo.list</a> &#45; Retrieve the list of credit memos by filters</li>
	<li><a href="sales_order_creditmemo.info.html" title="sales_order_creditmemo.info">sales_order_creditmemo.info</a> &#45; Retrieve the credit memo information</li>
	<li><a href="sales_order_creditmemo.create.html" title="sales_order_creditmemo.create">sales_order_creditmemo.create</a> &#45; Create a new credit memo for order</li>
	<li><a href="sales_order_creditmemo.addComment.html" title="sales_order_creditmemo.addComment">sales_order_creditmemo.addComment</a> &#45; Add a new comment to the credit memo</li>
	<li><a href="sales_order_creditmemo.cancel.html" title="sales_order_creditmemo.cancel">sales_order_creditmemo.cancel</a> &#45; Cancel the credit memo</li>
</ul>


<h5><a name="MAPI-OrderCreditMemo-Faults%3A"></a>Faults:</h5>


<table><tbody>
<tr>
<th> <font color="#333333">Fault Code</font> </th>
<th> <font color="#333333">Fault Message</font> </th>
</tr>
<tr>
<td> <font color="#333333">100</font> </td>
<td> <font color="#333333">Requested credit memo does not exist.</font> </td>
</tr>
<tr>
<td> <font color="#333333">101</font> </td>
<td> <font color="#333333">Invalid filter given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#333333">102</font> </td>
<td> <font color="#333333">Invalid data given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#333333">103</font> </td>
<td> <font color="#333333">Requested order does not exist.</font> </td>
</tr>
<tr>
<td> <font color="#333333">104</font> </td>
<td> <font color="#333333">Credit memo status not changed.</font> </td>
</tr>
<tr>
<td> <font color="#333333">105</font> </td>
<td> <font color="#333333">Money can not be refunded to the store credit account as order was created by guest.</font> </td>
</tr>
<tr>
<td> <font color="#333333">106</font> </td>
<td> <font color="#333333">Credit memo for requested order can not be created.</font> </td>
</tr>
</tbody></table>


<h5><a name="MAPI-OrderCreditMemo-Example%3A"></a>Example:</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

// Create creditmemo
$orderIncrementId = '100000683'; //increment id of the invoiced order
$data = array(
    'qtys' =&gt; array(
        '712' =&gt; 1
    ),
    'shipping_amount' =&gt; 3,
    'adjustment_positive' =&gt; 0.7,
    'adjustment_negative' =&gt; 0.06
);
$creditmemoIncrementId = $proxy-&gt;call($sessionId, 'order_creditmemo.create', array($orderIncrementId, $data));
echo $creditmemoIncrementId . "&lt;br /&gt;";

// Add comment to created creditmemo
$commentText = "Credit memo comment successfully added";
$isCommentAdded = $proxy-&gt;call($sessionId, 'order_creditmemo.addComment', array($creditmemoIncrementId, $commentText, true));

// Retrieve information about created creditmemo
$creditmemoInfo = $proxy-&gt;call($sessionId, 'order_creditmemo.info', array($creditmemoIncrementId));
print_r($creditmemoInfo);

// Retrieve list of creditmemos by filter
$filter = array(
    'increment_id' =&gt; array(
        'or' =&gt; array(
            array(
                'from' =&gt; '100000617',
                'to' =&gt; '100000619',
            ),
            array(
                'from' =&gt; $creditmemoIncrementId,
                'to' =&gt; NULL,
            )
        )
    )
);
$creditmemoList = $proxy-&gt;call($sessionId, 'order_creditmemo.list', array($filter));
print_r($creditmemoList);</pre>
		</div>
</div></div>

				    

                    			    
